package net.xdclass.order.feign;

import io.swagger.annotations.ApiParam;
import net.xdclass.common.JsonData;
import net.xdclass.order.model.request.LockProductRequest;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

@FeignClient(value = "xdclass-product-service")
public interface ProductFeignClient {

    /**
     * 根据商品id查询
     */
    @PostMapping("/api/cart/v1/confirmAmount")
    JsonData findProduct(@RequestBody List<Long> productIds);

    /**
     * 锁定商品库存
     * @param request
     * @return
     */
    @PostMapping("/api/product/v1/lock")
    JsonData lockProduct(@ApiParam("商品锁定对象") @RequestBody LockProductRequest request);
}
